/*
 * @Author: zhanglianchang
 * @Date: 2020-08-01 14:39:32
 * @Last Modified by: taoshiwei
 * @Last Modified time: 2019-04-29 14:49:44
 *
 * 题库有关的接口：自己写吧~~  已经被张老师删了 ^_^
 */
import { createAPI } from '@/utils/request'
// 获取基础题库列表的接口
export const getQuestionList = data => createAPI('/questions', 'get', data)
// 获取 删除的接口
export const deleteTest = data => createAPI(`/questions/${data}`, 'delete', data)
// 添加到精选题库
export const addTestToChioce = data => createAPI(`/questions/choice/${data}/1`, 'patch', data)
// 获取该列试题的详情接口
export const detailsList = data => createAPI(`/questions/${data}`, 'get', data)

/* 组题列表 */
export const list = data => createAPI('/questions/randoms', 'get', data)

/* 删除组题列表 */
export const remove = data => createAPI(`/questions/randoms/${data.id}`, 'delete', data)
/* 试题审核 */
export const listview = data => createAPI('/questions/choice', 'get', data)
// 试题审核删除
export const questionDel = data => createAPI(`/questions/${data.id}`, 'delete', data)
//试题审核上下架
export const choicePublish = data =>
  createAPI(`/questions/choice/${data.id}/${data.publishState}`, 'post', data)

// 试题审核
export const audit = data => createAPI(`/questions/check/${data.id}`, 'POST', data)
//基础题库详情
export const detail = data => createAPI(`/questions/${data.id}`, 'get', data)
